#!/bin/sh
#
# HIDOCD:
#
# chkconfig:	2345 70 40
# description:  HIDOCD
#
#

# Source function library.
. /etc/rc.d/init.d/functions

#[ -r /etc/sysconfig/hidocd ] && . /etc/sysconfig/hidocd
HIDOCDARGS=" -d -c /usr/local/etc/hidocd.ini > /tmp/hidocd.log 2>&1 "

start() 
{
    echo -n $"Starting hidocd: "
    daemon /usr/local/sbin/hidocd $HIDOCDARGS

    touch /var/lock/subsys/hidocd
    echo
}

stop() 
{
    echo -n $"Shutting down hidocd: "
    killproc hidocd

    rm -f  /var/lock/subsys/hidocd
    echo
}

[ -f /usr/local/sbin/hidocd ] || exit 0

# See how we were called.
case "$1" in
    start)
    start
    ;;
    stop)
    stop
    ;;
    restart|reload)
    stop
    start
    ;;
    condrestart)
    [ -e /var/lock/subsys/hidocd ] && (stop; start)
    ;;
    status)
    status hidd
    ;;
    *)
    echo $"Usage: $0 {start|stop|restart|reload|condrestart}"
    exit 1
esac

exit 0
